from google.appengine.ext import webapp
from DataClass.WebsiteRec import WebsiteRec
from google.appengine.api import users
from google.appengine.ext.webapp import template
from AdminListBase import AdminListBase
from PSData.PSInstitution import PSInstitution 
from DataClass.SiteUser import SiteUser

import os
import cgi 

class InstitutionListHandler(AdminListBase):
    def GetBreadcrumbLink(self):
        return "institutionlist"

    def GetBreadcrumbDisplayName(self):
        return "Institution List"

    def GetListHeading(self):
        return "Institutions"

    def GetSingleItemDisplayName(self):
        return "Institution"

    def GetSingleItemLink(self):
        return "institutiondetail"

    # return a query on the items that we want
    def GetListQuery(self, template_values, user):
        siteuser = SiteUser.GetSiteUserFromEmail(user.email())
        return PSInstitution.all() #.filter('user =', siteuser)

    def GetItemTemplateFileName(self):
        return "institutionlistitem.html"

